<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function foo(a,b,c){
            var qaq = 0;
            if( a > b ){
                qaq = a;
                a = b;
                b =qaq;
            }
            console.log(a,b,c);
            if( a > c ){
                qaq = a;
                a = c;
                c =qaq;
            }
            console.log(a,b,c);
            if( b > c ){
                qaq = b;
                b = c;
                c =qaq;
            }
            console.log(a,b,c);
        }
        foo(2,3,1);
    </script>
</body>
</html>